import request from '@/utils/request.js'
import apis from '@/utils/api'
/**
 * @param {Object} params
 * 地址
 */
export function getAddressList(params) {
	return request.globalRequest(apis.getAddressList, 'POST', params)
}
export function setDefault(params) {
	return request.globalRequest(apis.setDefault, 'POST', params)
}
export function saveAddress(params) {
	if (params.id) {
		return request.globalRequest(apis.editAddress, 'POST', params)
	} else {
		return request.globalRequest(apis.addAddress, 'POST', params)
	}
}
export function removeAddress(params) {
	return request.globalRequest(apis.removeAddress, 'POST', params)
}

export default {
	getAddressList,
	setDefault,
	saveAddress,
	removeAddress,
}